import request from '@/utils/request2'
import qs from 'qs'


export function getBpmnModelCategory(data) {
  return request({

    url: '/a1bpmn/sys/sysType/v1/getTypesByKey',
    method: 'get'

  })
}

export function getRuTaskData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/runtime/task/v2/list',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getHisTaskData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/history/task/v2/list/',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getMeToData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/transferTaskLog/get/meTo',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getToMeData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/transferTaskLog/get/toMe',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getTaskDelayedData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/runtime/task/v2/taskDelayed',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getCommuData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/commu/list',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getHisCommuData(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/commu/his/list',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function tagReadTimeAllNotification(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/commu/tagReadTimeAllNotification',
    method: 'post',
    data: qs.stringify(data)

  })
}
export function getstartUpRunning(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: 'a1bpmn/api/startUp/list/running',
    method: 'post',
    data: qs.stringify(data)


  })
}
export function getstartUpHis(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/startUp/his/list',
    method: 'post',
    data: qs.stringify(data)
  })
}
export function getTopic(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/topic/get/'+data.id,
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 获取冒泡数据
 * @param data
 */
export function getHomePortalList(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/portal/homePortal/list',
    method: 'post'
  })
}
export function senHomePortal(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/portal/homePortal/sendBubbleMsg',
    method: 'post',
    data: qs.stringify(data)
  })
}

/**
 * 加载首页模块
 * @param data
 */
export function loadWfModule() {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: '/a1bpmn/api/menu/menu/loadWfModule',
    method: 'post',
  })
}

export function getFormInfo(id) {
  return request({
    url: '/a1bpmn/api/formType/'+id,
    method: 'GET',
  })
}
export function getFormInfoByProcId(id) {
  return request({
    url: '/a1bpmn/api/formType/byProcId/'+id,
    method: 'GET',
  })
}


